add class to body javascript

55

add classnames to body -

openModal = (event) => {
  document.body.classList.add('modal-open');
  this.setState({ showModal: true });
}
hideModal = (event) => {
  document.body.classList.remove('modal-open');
  this.setState({ showModal: false });
}

add class to body javascript -

document.body.className += ' home';

Comments

Submit
0 Comments